package kii.events
{
	

	/**
	 * Fault Event, dispached by kii.wapis.IService and it's implementors.
	 * @author Nirth
	 */
	public class FaultEvent extends KiiEvent
	{
		public static var FAULT:String = 'fault';
		/**
		 * Constructs new <code>FaultEvent</code> instance. 
		 * @param type  Event type.
		 * @param fault Fault string.
		 * @param data  Additional fault data or message.
		 */		
		public function FaultEvent(type:String, fault:String = 'Fault', data:Object = null)
		{
			super(type);
			_fault = fault;
			_data = data;
		}
		/**
		 * @private
		 */
		private var _fault:String;
		/**
		 * Fault string. 
		 */
		public function get fault():String
		{
			return _fault;
		}
		/**
		 * @private
		 */
		private var _data:Object;
		/**
		 * Additional fault data or message.
		 */
		public function get data():Object
		{
			return _data;
		}
		/**
		 * @inheritDoc
		 */
		override public function toString():String
		{
			return formatToString('FaultEvent', 'type', 'fault');
		}
		
	}
}